(0) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^2).


The TRS R consists of the following rules:

+(0, y) → y
+(s(x), y) → s(+(x, y))
++(nil, ys) → ys
++(:(x, xs), ys) → :(x, ++(xs, ys))
sum(:(x, nil)) → :(x, nil)
sum(:(x, :(y, xs))) → sum(:(+(x, y), xs))
sum(++(xs, :(x, :(y, ys)))) → sum(++(xs, sum(:(x, :(y, ys)))))
-(x, 0) → x
-(0, s(y)) → 0
-(s(x), s(y)) → -(x, y)
quot(0, s(y)) → 0
quot(s(x), s(y)) → s(quot(-(x, y), s(y)))
length(nil) → 0
length(:(x, xs)) → s(length(xs))
hd(:(x, xs)) → x
avg(xs) → quot(hd(sum(xs)), length(xs))

Rewrite Strategy: INNERMOST

(1) NestedDefinedSymbolProof (BOTH BOUNDS(ID, ID) transformation)

The following defined symbols can occur below the 0th argument of +: +
The following defined symbols can occur below the 1th argument of +: +
The following defined symbols can occur below the 0th argument of sum: +
The following defined symbols can occur below the 0th argument of quot: hd, sum, +, -, length
The following defined symbols can occur below the 1th argument of quot: length
The following defined symbols can occur below the 0th argument of hd: sum, +
The following defined symbols can occur below the 0th argument of -: hd, sum, +, -
The following defined symbols can occur below the 1th argument of -: length

Hence, the left-hand sides of the following rules are not basic-reachable and can be removed:
sum(++(xs, :(x, :(y, ys)))) → sum(++(xs, sum(:(x, :(y, ys)))))

(2) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^2).


The TRS R consists of the following rules:

++(:(x, xs), ys) → :(x, ++(xs, ys))
-(s(x), s(y)) → -(x, y)
++(nil, ys) → ys
length(:(x, xs)) → s(length(xs))
quot(0, s(y)) → 0
avg(xs) → quot(hd(sum(xs)), length(xs))
+(s(x), y) → s(+(x, y))
-(0, s(y)) → 0
quot(s(x), s(y)) → s(quot(-(x, y), s(y)))
-(x, 0) → x
sum(:(x, :(y, xs))) → sum(:(+(x, y), xs))
sum(:(x, nil)) → :(x, nil)
length(nil) → 0
+(0, y) → y
hd(:(x, xs)) → x

Rewrite Strategy: INNERMOST

(3) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)

Converted Cpx (relative) TRS to CDT

(4) Obligation:

Complexity Dependency Tuples Problem
Rules:

++(:(z0, z1), z2) → :(z0, ++(z1, z2))
++(nil, z0) → z0
-(s(z0), s(z1)) → -(z0, z1)
-(0, s(z0)) → 0
-(z0, 0) → z0
length(:(z0, z1)) → s(length(z1))
length(nil) → 0
quot(0, s(z0)) → 0
quot(s(z0), s(z1)) → s(quot(-(z0, z1), s(z1)))
avg(z0) → quot(hd(sum(z0)), length(z0))
+(s(z0), z1) → s(+(z0, z1))
+(0, z0) → z0
sum(:(z0, :(z1, z2))) → sum(:(+(z0, z1), z2))
sum(:(z0, nil)) → :(z0, nil)
hd(:(z0, z1)) → z0
Tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
++'(nil, z0) → c1
-'(s(z0), s(z1)) → c2(-'(z0, z1))
-'(0, s(z0)) → c3
-'(z0, 0) → c4
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
LENGTH(nil) → c6
QUOT(0, s(z0)) → c7
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
AVG(z0) → c9(QUOT(hd(sum(z0)), length(z0)), HD(sum(z0)), SUM(z0), LENGTH(z0))
+'(s(z0), z1) → c10(+'(z0, z1))
+'(0, z0) → c11
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
SUM(:(z0, nil)) → c13
HD(:(z0, z1)) → c14
S tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
++'(nil, z0) → c1
-'(s(z0), s(z1)) → c2(-'(z0, z1))
-'(0, s(z0)) → c3
-'(z0, 0) → c4
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
LENGTH(nil) → c6
QUOT(0, s(z0)) → c7
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
AVG(z0) → c9(QUOT(hd(sum(z0)), length(z0)), HD(sum(z0)), SUM(z0), LENGTH(z0))
+'(s(z0), z1) → c10(+'(z0, z1))
+'(0, z0) → c11
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
SUM(:(z0, nil)) → c13
HD(:(z0, z1)) → c14
K tuples:none
Defined Rule Symbols:

++, -, length, quot, avg, +, sum, hd

Defined Pair Symbols:

++', -', LENGTH, QUOT, AVG, +', SUM, HD

Compound Symbols:

c, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14

(5) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID) transformation)

Removed 8 trailing nodes:

-'(0, s(z0)) → c3
SUM(:(z0, nil)) → c13
QUOT(0, s(z0)) → c7
-'(z0, 0) → c4
LENGTH(nil) → c6
+'(0, z0) → c11
++'(nil, z0) → c1
HD(:(z0, z1)) → c14

(6) Obligation:

Complexity Dependency Tuples Problem
Rules:

++(:(z0, z1), z2) → :(z0, ++(z1, z2))
++(nil, z0) → z0
-(s(z0), s(z1)) → -(z0, z1)
-(0, s(z0)) → 0
-(z0, 0) → z0
length(:(z0, z1)) → s(length(z1))
length(nil) → 0
quot(0, s(z0)) → 0
quot(s(z0), s(z1)) → s(quot(-(z0, z1), s(z1)))
avg(z0) → quot(hd(sum(z0)), length(z0))
+(s(z0), z1) → s(+(z0, z1))
+(0, z0) → z0
sum(:(z0, :(z1, z2))) → sum(:(+(z0, z1), z2))
sum(:(z0, nil)) → :(z0, nil)
hd(:(z0, z1)) → z0
Tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
-'(s(z0), s(z1)) → c2(-'(z0, z1))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
AVG(z0) → c9(QUOT(hd(sum(z0)), length(z0)), HD(sum(z0)), SUM(z0), LENGTH(z0))
+'(s(z0), z1) → c10(+'(z0, z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
S tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
-'(s(z0), s(z1)) → c2(-'(z0, z1))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
AVG(z0) → c9(QUOT(hd(sum(z0)), length(z0)), HD(sum(z0)), SUM(z0), LENGTH(z0))
+'(s(z0), z1) → c10(+'(z0, z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
K tuples:none
Defined Rule Symbols:

++, -, length, quot, avg, +, sum, hd

Defined Pair Symbols:

++', -', LENGTH, QUOT, AVG, +', SUM

Compound Symbols:

c, c2, c5, c8, c9, c10, c12

(7) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID) transformation)

Removed 1 trailing tuple parts

(8) Obligation:

Complexity Dependency Tuples Problem
Rules:

++(:(z0, z1), z2) → :(z0, ++(z1, z2))
++(nil, z0) → z0
-(s(z0), s(z1)) → -(z0, z1)
-(0, s(z0)) → 0
-(z0, 0) → z0
length(:(z0, z1)) → s(length(z1))
length(nil) → 0
quot(0, s(z0)) → 0
quot(s(z0), s(z1)) → s(quot(-(z0, z1), s(z1)))
avg(z0) → quot(hd(sum(z0)), length(z0))
+(s(z0), z1) → s(+(z0, z1))
+(0, z0) → z0
sum(:(z0, :(z1, z2))) → sum(:(+(z0, z1), z2))
sum(:(z0, nil)) → :(z0, nil)
hd(:(z0, z1)) → z0
Tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
-'(s(z0), s(z1)) → c2(-'(z0, z1))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
AVG(z0) → c9(QUOT(hd(sum(z0)), length(z0)), SUM(z0), LENGTH(z0))
S tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
-'(s(z0), s(z1)) → c2(-'(z0, z1))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
AVG(z0) → c9(QUOT(hd(sum(z0)), length(z0)), SUM(z0), LENGTH(z0))
K tuples:none
Defined Rule Symbols:

++, -, length, quot, avg, +, sum, hd

Defined Pair Symbols:

++', -', LENGTH, QUOT, +', SUM, AVG

Compound Symbols:

c, c2, c5, c8, c10, c12, c9

(9) CdtGraphSplitRhsProof (BOTH BOUNDS(ID, ID) transformation)

Split RHS of tuples not part of any SCC

(10) Obligation:

Complexity Dependency Tuples Problem
Rules:

++(:(z0, z1), z2) → :(z0, ++(z1, z2))
++(nil, z0) → z0
-(s(z0), s(z1)) → -(z0, z1)
-(0, s(z0)) → 0
-(z0, 0) → z0
length(:(z0, z1)) → s(length(z1))
length(nil) → 0
quot(0, s(z0)) → 0
quot(s(z0), s(z1)) → s(quot(-(z0, z1), s(z1)))
avg(z0) → quot(hd(sum(z0)), length(z0))
+(s(z0), z1) → s(+(z0, z1))
+(0, z0) → z0
sum(:(z0, :(z1, z2))) → sum(:(+(z0, z1), z2))
sum(:(z0, nil)) → :(z0, nil)
hd(:(z0, z1)) → z0
Tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
-'(s(z0), s(z1)) → c2(-'(z0, z1))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))
AVG(z0) → c1(SUM(z0))
AVG(z0) → c1(LENGTH(z0))
S tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
-'(s(z0), s(z1)) → c2(-'(z0, z1))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))
AVG(z0) → c1(SUM(z0))
AVG(z0) → c1(LENGTH(z0))
K tuples:none
Defined Rule Symbols:

++, -, length, quot, avg, +, sum, hd

Defined Pair Symbols:

++', -', LENGTH, QUOT, +', SUM, AVG

Compound Symbols:

c, c2, c5, c8, c10, c12, c1

(11) CdtLeafRemovalProof (ComplexityIfPolyImplication transformation)

Removed 2 leading nodes:

AVG(z0) → c1(LENGTH(z0))
AVG(z0) → c1(SUM(z0))

(12) Obligation:

Complexity Dependency Tuples Problem
Rules:

++(:(z0, z1), z2) → :(z0, ++(z1, z2))
++(nil, z0) → z0
-(s(z0), s(z1)) → -(z0, z1)
-(0, s(z0)) → 0
-(z0, 0) → z0
length(:(z0, z1)) → s(length(z1))
length(nil) → 0
quot(0, s(z0)) → 0
quot(s(z0), s(z1)) → s(quot(-(z0, z1), s(z1)))
avg(z0) → quot(hd(sum(z0)), length(z0))
+(s(z0), z1) → s(+(z0, z1))
+(0, z0) → z0
sum(:(z0, :(z1, z2))) → sum(:(+(z0, z1), z2))
sum(:(z0, nil)) → :(z0, nil)
hd(:(z0, z1)) → z0
Tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
-'(s(z0), s(z1)) → c2(-'(z0, z1))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))
S tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
-'(s(z0), s(z1)) → c2(-'(z0, z1))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))
K tuples:none
Defined Rule Symbols:

++, -, length, quot, avg, +, sum, hd

Defined Pair Symbols:

++', -', LENGTH, QUOT, +', SUM, AVG

Compound Symbols:

c, c2, c5, c8, c10, c12, c1

(13) CdtKnowledgeProof (BOTH BOUNDS(ID, ID) transformation)

The following tuples could be moved from S to K by knowledge propagation:

AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))

(14) Obligation:

Complexity Dependency Tuples Problem
Rules:

++(:(z0, z1), z2) → :(z0, ++(z1, z2))
++(nil, z0) → z0
-(s(z0), s(z1)) → -(z0, z1)
-(0, s(z0)) → 0
-(z0, 0) → z0
length(:(z0, z1)) → s(length(z1))
length(nil) → 0
quot(0, s(z0)) → 0
quot(s(z0), s(z1)) → s(quot(-(z0, z1), s(z1)))
avg(z0) → quot(hd(sum(z0)), length(z0))
+(s(z0), z1) → s(+(z0, z1))
+(0, z0) → z0
sum(:(z0, :(z1, z2))) → sum(:(+(z0, z1), z2))
sum(:(z0, nil)) → :(z0, nil)
hd(:(z0, z1)) → z0
Tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
-'(s(z0), s(z1)) → c2(-'(z0, z1))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))
S tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
-'(s(z0), s(z1)) → c2(-'(z0, z1))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
K tuples:

AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))
Defined Rule Symbols:

++, -, length, quot, avg, +, sum, hd

Defined Pair Symbols:

++', -', LENGTH, QUOT, +', SUM, AVG

Compound Symbols:

c, c2, c5, c8, c10, c12, c1

(15) CdtUsableRulesProof (EQUIVALENT transformation)

The following rules are not usable and were removed:

++(:(z0, z1), z2) → :(z0, ++(z1, z2))
++(nil, z0) → z0
quot(0, s(z0)) → 0
quot(s(z0), s(z1)) → s(quot(-(z0, z1), s(z1)))
avg(z0) → quot(hd(sum(z0)), length(z0))

(16) Obligation:

Complexity Dependency Tuples Problem
Rules:

-(s(z0), s(z1)) → -(z0, z1)
-(0, s(z0)) → 0
-(z0, 0) → z0
+(s(z0), z1) → s(+(z0, z1))
+(0, z0) → z0
hd(:(z0, z1)) → z0
sum(:(z0, :(z1, z2))) → sum(:(+(z0, z1), z2))
sum(:(z0, nil)) → :(z0, nil)
length(:(z0, z1)) → s(length(z1))
length(nil) → 0
Tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
-'(s(z0), s(z1)) → c2(-'(z0, z1))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))
S tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
-'(s(z0), s(z1)) → c2(-'(z0, z1))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
K tuples:

AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))
Defined Rule Symbols:

-, +, hd, sum, length

Defined Pair Symbols:

++', -', LENGTH, QUOT, +', SUM, AVG

Compound Symbols:

c, c2, c5, c8, c10, c12, c1

(17) CdtRuleRemovalProof (UPPER BOUND(ADD(n^1)) transformation)

Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.

++'(:(z0, z1), z2) → c(++'(z1, z2))
We considered the (Usable) Rules:none
And the Tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
-'(s(z0), s(z1)) → c2(-'(z0, z1))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(+(x1, x2)) = 0   
POL(+'(x1, x2)) = 0   
POL(++'(x1, x2)) = x1   
POL(-(x1, x2)) = 0   
POL(-'(x1, x2)) = 0   
POL(0) = 0   
POL(:(x1, x2)) = [1] + x2   
POL(AVG(x1)) = 0   
POL(LENGTH(x1)) = 0   
POL(QUOT(x1, x2)) = 0   
POL(SUM(x1)) = 0   
POL(c(x1)) = x1   
POL(c1(x1)) = x1   
POL(c10(x1)) = x1   
POL(c12(x1, x2)) = x1 + x2   
POL(c2(x1)) = x1   
POL(c5(x1)) = x1   
POL(c8(x1, x2)) = x1 + x2   
POL(hd(x1)) = 0   
POL(length(x1)) = 0   
POL(nil) = 0   
POL(s(x1)) = 0   
POL(sum(x1)) = 0   

(18) Obligation:

Complexity Dependency Tuples Problem
Rules:

-(s(z0), s(z1)) → -(z0, z1)
-(0, s(z0)) → 0
-(z0, 0) → z0
+(s(z0), z1) → s(+(z0, z1))
+(0, z0) → z0
hd(:(z0, z1)) → z0
sum(:(z0, :(z1, z2))) → sum(:(+(z0, z1), z2))
sum(:(z0, nil)) → :(z0, nil)
length(:(z0, z1)) → s(length(z1))
length(nil) → 0
Tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
-'(s(z0), s(z1)) → c2(-'(z0, z1))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))
S tuples:

-'(s(z0), s(z1)) → c2(-'(z0, z1))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
K tuples:

AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))
++'(:(z0, z1), z2) → c(++'(z1, z2))
Defined Rule Symbols:

-, +, hd, sum, length

Defined Pair Symbols:

++', -', LENGTH, QUOT, +', SUM, AVG

Compound Symbols:

c, c2, c5, c8, c10, c12, c1

(19) CdtRuleRemovalProof (UPPER BOUND(ADD(n^1)) transformation)

Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.

LENGTH(:(z0, z1)) → c5(LENGTH(z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
We considered the (Usable) Rules:none
And the Tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
-'(s(z0), s(z1)) → c2(-'(z0, z1))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(+(x1, x2)) = 0   
POL(+'(x1, x2)) = 0   
POL(++'(x1, x2)) = 0   
POL(-(x1, x2)) = [1] + x1   
POL(-'(x1, x2)) = 0   
POL(0) = [1]   
POL(:(x1, x2)) = [1] + x2   
POL(AVG(x1)) = x1   
POL(LENGTH(x1)) = x1   
POL(QUOT(x1, x2)) = 0   
POL(SUM(x1)) = x1   
POL(c(x1)) = x1   
POL(c1(x1)) = x1   
POL(c10(x1)) = x1   
POL(c12(x1, x2)) = x1 + x2   
POL(c2(x1)) = x1   
POL(c5(x1)) = x1   
POL(c8(x1, x2)) = x1 + x2   
POL(hd(x1)) = 0   
POL(length(x1)) = 0   
POL(nil) = 0   
POL(s(x1)) = x1   
POL(sum(x1)) = 0   

(20) Obligation:

Complexity Dependency Tuples Problem
Rules:

-(s(z0), s(z1)) → -(z0, z1)
-(0, s(z0)) → 0
-(z0, 0) → z0
+(s(z0), z1) → s(+(z0, z1))
+(0, z0) → z0
hd(:(z0, z1)) → z0
sum(:(z0, :(z1, z2))) → sum(:(+(z0, z1), z2))
sum(:(z0, nil)) → :(z0, nil)
length(:(z0, z1)) → s(length(z1))
length(nil) → 0
Tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
-'(s(z0), s(z1)) → c2(-'(z0, z1))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))
S tuples:

-'(s(z0), s(z1)) → c2(-'(z0, z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
K tuples:

AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))
++'(:(z0, z1), z2) → c(++'(z1, z2))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
Defined Rule Symbols:

-, +, hd, sum, length

Defined Pair Symbols:

++', -', LENGTH, QUOT, +', SUM, AVG

Compound Symbols:

c, c2, c5, c8, c10, c12, c1

(21) CdtRuleRemovalProof (UPPER BOUND(ADD(n^1)) transformation)

Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.

QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
We considered the (Usable) Rules:

-(0, s(z0)) → 0
+(s(z0), z1) → s(+(z0, z1))
-(s(z0), s(z1)) → -(z0, z1)
-(z0, 0) → z0
sum(:(z0, :(z1, z2))) → sum(:(+(z0, z1), z2))
sum(:(z0, nil)) → :(z0, nil)
+(0, z0) → z0
hd(:(z0, z1)) → z0
And the Tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
-'(s(z0), s(z1)) → c2(-'(z0, z1))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(+(x1, x2)) = x1 + x2   
POL(+'(x1, x2)) = 0   
POL(++'(x1, x2)) = x1   
POL(-(x1, x2)) = x1   
POL(-'(x1, x2)) = 0   
POL(0) = 0   
POL(:(x1, x2)) = [1] + x1 + x2   
POL(AVG(x1)) = [3] + [3]x1   
POL(LENGTH(x1)) = 0   
POL(QUOT(x1, x2)) = [1] + [2]x1   
POL(SUM(x1)) = 0   
POL(c(x1)) = x1   
POL(c1(x1)) = x1   
POL(c10(x1)) = x1   
POL(c12(x1, x2)) = x1 + x2   
POL(c2(x1)) = x1   
POL(c5(x1)) = x1   
POL(c8(x1, x2)) = x1 + x2   
POL(hd(x1)) = x1   
POL(length(x1)) = x1   
POL(nil) = 0   
POL(s(x1)) = [1] + x1   
POL(sum(x1)) = [1] + x1   

(22) Obligation:

Complexity Dependency Tuples Problem
Rules:

-(s(z0), s(z1)) → -(z0, z1)
-(0, s(z0)) → 0
-(z0, 0) → z0
+(s(z0), z1) → s(+(z0, z1))
+(0, z0) → z0
hd(:(z0, z1)) → z0
sum(:(z0, :(z1, z2))) → sum(:(+(z0, z1), z2))
sum(:(z0, nil)) → :(z0, nil)
length(:(z0, z1)) → s(length(z1))
length(nil) → 0
Tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
-'(s(z0), s(z1)) → c2(-'(z0, z1))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))
S tuples:

-'(s(z0), s(z1)) → c2(-'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
K tuples:

AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))
++'(:(z0, z1), z2) → c(++'(z1, z2))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
Defined Rule Symbols:

-, +, hd, sum, length

Defined Pair Symbols:

++', -', LENGTH, QUOT, +', SUM, AVG

Compound Symbols:

c, c2, c5, c8, c10, c12, c1

(23) CdtRuleRemovalProof (UPPER BOUND(ADD(n^2)) transformation)

Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.

+'(s(z0), z1) → c10(+'(z0, z1))
We considered the (Usable) Rules:

+(s(z0), z1) → s(+(z0, z1))
+(0, z0) → z0
And the Tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
-'(s(z0), s(z1)) → c2(-'(z0, z1))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(+(x1, x2)) = x1 + x2   
POL(+'(x1, x2)) = [1] + [2]x1 + x2   
POL(++'(x1, x2)) = x1·x2 + x12   
POL(-(x1, x2)) = [2]x2 + [2]x22   
POL(-'(x1, x2)) = 0   
POL(0) = 0   
POL(:(x1, x2)) = [1] + x1 + x2   
POL(AVG(x1)) = [2]   
POL(LENGTH(x1)) = 0   
POL(QUOT(x1, x2)) = [1]   
POL(SUM(x1)) = [2]x12   
POL(c(x1)) = x1   
POL(c1(x1)) = x1   
POL(c10(x1)) = x1   
POL(c12(x1, x2)) = x1 + x2   
POL(c2(x1)) = x1   
POL(c5(x1)) = x1   
POL(c8(x1, x2)) = x1 + x2   
POL(hd(x1)) = 0   
POL(length(x1)) = [2] + [2]x12   
POL(nil) = [1]   
POL(s(x1)) = [2] + x1   
POL(sum(x1)) = [2]   

(24) Obligation:

Complexity Dependency Tuples Problem
Rules:

-(s(z0), s(z1)) → -(z0, z1)
-(0, s(z0)) → 0
-(z0, 0) → z0
+(s(z0), z1) → s(+(z0, z1))
+(0, z0) → z0
hd(:(z0, z1)) → z0
sum(:(z0, :(z1, z2))) → sum(:(+(z0, z1), z2))
sum(:(z0, nil)) → :(z0, nil)
length(:(z0, z1)) → s(length(z1))
length(nil) → 0
Tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
-'(s(z0), s(z1)) → c2(-'(z0, z1))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))
S tuples:

-'(s(z0), s(z1)) → c2(-'(z0, z1))
K tuples:

AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))
++'(:(z0, z1), z2) → c(++'(z1, z2))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
Defined Rule Symbols:

-, +, hd, sum, length

Defined Pair Symbols:

++', -', LENGTH, QUOT, +', SUM, AVG

Compound Symbols:

c, c2, c5, c8, c10, c12, c1

(25) CdtRuleRemovalProof (UPPER BOUND(ADD(n^2)) transformation)

Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.

-'(s(z0), s(z1)) → c2(-'(z0, z1))
We considered the (Usable) Rules:

-(0, s(z0)) → 0
+(s(z0), z1) → s(+(z0, z1))
-(s(z0), s(z1)) → -(z0, z1)
-(z0, 0) → z0
sum(:(z0, :(z1, z2))) → sum(:(+(z0, z1), z2))
length(:(z0, z1)) → s(length(z1))
sum(:(z0, nil)) → :(z0, nil)
length(nil) → 0
+(0, z0) → z0
hd(:(z0, z1)) → z0
And the Tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
-'(s(z0), s(z1)) → c2(-'(z0, z1))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(+(x1, x2)) = x1 + x2   
POL(+'(x1, x2)) = 0   
POL(++'(x1, x2)) = x1·x2   
POL(-(x1, x2)) = x1   
POL(-'(x1, x2)) = [1] + [2]x2   
POL(0) = 0   
POL(:(x1, x2)) = [1] + x1 + x2   
POL(AVG(x1)) = [2]x12   
POL(LENGTH(x1)) = x12   
POL(QUOT(x1, x2)) = [2]x1·x2   
POL(SUM(x1)) = 0   
POL(c(x1)) = x1   
POL(c1(x1)) = x1   
POL(c10(x1)) = x1   
POL(c12(x1, x2)) = x1 + x2   
POL(c2(x1)) = x1   
POL(c5(x1)) = x1   
POL(c8(x1, x2)) = x1 + x2   
POL(hd(x1)) = x1   
POL(length(x1)) = x1   
POL(nil) = 0   
POL(s(x1)) = [1] + x1   
POL(sum(x1)) = x1   

(26) Obligation:

Complexity Dependency Tuples Problem
Rules:

-(s(z0), s(z1)) → -(z0, z1)
-(0, s(z0)) → 0
-(z0, 0) → z0
+(s(z0), z1) → s(+(z0, z1))
+(0, z0) → z0
hd(:(z0, z1)) → z0
sum(:(z0, :(z1, z2))) → sum(:(+(z0, z1), z2))
sum(:(z0, nil)) → :(z0, nil)
length(:(z0, z1)) → s(length(z1))
length(nil) → 0
Tuples:

++'(:(z0, z1), z2) → c(++'(z1, z2))
-'(s(z0), s(z1)) → c2(-'(z0, z1))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))
S tuples:none
K tuples:

AVG(z0) → c1(QUOT(hd(sum(z0)), length(z0)))
++'(:(z0, z1), z2) → c(++'(z1, z2))
LENGTH(:(z0, z1)) → c5(LENGTH(z1))
SUM(:(z0, :(z1, z2))) → c12(SUM(:(+(z0, z1), z2)), +'(z0, z1))
QUOT(s(z0), s(z1)) → c8(QUOT(-(z0, z1), s(z1)), -'(z0, z1))
+'(s(z0), z1) → c10(+'(z0, z1))
-'(s(z0), s(z1)) → c2(-'(z0, z1))
Defined Rule Symbols:

-, +, hd, sum, length

Defined Pair Symbols:

++', -', LENGTH, QUOT, +', SUM, AVG

Compound Symbols:

c, c2, c5, c8, c10, c12, c1

(27) SIsEmptyProof (BOTH BOUNDS(ID, ID) transformation)

The set S is empty

(28) BOUNDS(1, 1)